Repository navigation
feat(v1): add CleaningMode.VAC_THEN_MOP - #1024
Open
paulleonartcalvo wants to merge 4 commits into
Open
paulleonartcalvo wants to merge 4 commits into
paulleonartcalvo wants to merge 4 commits into
Conversation
The device reports seq_type in its get_status payload, but StatusV2 did not model it, so RoborockBase.from_dict discarded it along with every other unmatched key. The vendor app reads the same field off the same payload to derive its "clean then mop" state. Add seq_type to StatusV2 and a clean_then_mop property on StatusTrait that reports whether the current run vacuums each room fully before mopping it. It describes the run in progress rather than a persisted setting, and the device offers no setter, so it is read only here; the value travels outbound as a parameter of the cleaning command instead. Gated for reporting on is_clean_then_mop_mode_supported. Verified against a Roborock Saros 20 (roborock.vacuum.a288).
Model the app's "Vacuum then mop" choice as a fourth high-level cleaning mode, as suggested in review of Python-roborock#959, so consumers such as Home Assistant get it through cleaning_mode_options / current_cleaning_mode / set_cleaning_mode without orchestrating a separate control. - Offer VAC_THEN_MOP when is_clean_then_mop_mode_supported. - Report it when vacuum-and-mop settings run with seq_type 1. - set_cleaning_mode writes the vacuum-and-mop motor settings, then app_set_clean_sequence_type with type 1 (repeat 1 when is_ctm_with_repeat_supported); switching to another mode while it is enabled sends type 0, like the app. - clean_then_mop returns None on devices without the feature. - Replace the separate set_clean_then_mop setter with the mode, and share SEQ_TYPE_CLEAN_THEN_MOP with the per-room customize clean mode trait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #959 and implements the direction @allenporter suggested in this review comment: fold "clean then mop" into
CleaningModeas a fourth mode, so consumers like Home Assistant get it through the existing cleaning mode select instead of a separate control. Closes #914.The first three commits are @klowdo's from #959, rebased onto
mainunchanged. The last commit adds the mode on top. Happy to fold this into #959 instead if that is easier.Changes
CleaningMode.VAC_THEN_MOP("vac_then_mop"), offered inget_cleaning_mode_options()whenis_clean_then_mop_mode_supported.get_current_cleaning_mode()takes an optionalseq_typeand reportsVAC_THEN_MOPfor vacuum-and-mop settings withseq_type == 1;StatusTrait.current_cleaning_modepasses it through.StatusTrait.set_cleaning_mode():VAC_THEN_MOP: writes the vacuum-and-mop motor settings withset_clean_motor_mode, thenapp_set_clean_sequence_typewithtype: 1and the same motor values (repeat: 1whenis_ctm_with_repeat_supported).type: 0after the motor write, like the app. Nothing extra is sent when it is already off or unsupported.clean_then_mopreturnsNoneon devices without the feature (point 3 of the review).set_clean_then_mop()setter from feat(v1): expose clean-then-mop status from the device #959, since the mode now covers it and a standalone setter can produce the conflictingtype: 1withwater_box_mode: 200case from the review. Easy to restore if you would rather keep it.SEQ_TYPE_CLEAN_THEN_MOPnow lives inv1_clean_modesand is shared with the per-roomCustomizeCleanModeTrait(feat(v1): expose per-room clean-then-mop via customize clean mode #984).Device testing
Qrevo Edge 3 Pro (
roborock.vacuum.a296, water slide,isCleanThenMopModeSupportedandisCtmWithRepeatSupportedboth true):app_set_clean_sequence_type{"type": 1, "water_box_mode": 248, "mop_mode": 300, "fan_power": 102, "repeat": 1}. The robot answeredok.seq_typeback fromget_status(verified on the Saros 20 in feat(v1): expose clean-then-mop status from the device #959).uv run pytest(2301 passed) anduv run pre-commit run --all-filespass.🤖 Generated with Claude Code